/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.guet.careapp.pojo;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author LXM
 */
@Entity
@Table(name = "t_service_message_info")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TServiceMessageInfo.findAll", query = "SELECT t FROM TServiceMessageInfo t"),
    @NamedQuery(name = "TServiceMessageInfo.findById", query = "SELECT t FROM TServiceMessageInfo t WHERE t.id = :id"),
    @NamedQuery(name = "TServiceMessageInfo.findByType", query = "SELECT t FROM TServiceMessageInfo t WHERE t.type = :type"),
    @NamedQuery(name = "TServiceMessageInfo.findByTime", query = "SELECT t FROM TServiceMessageInfo t WHERE t.time = :time"),
    @NamedQuery(name = "TServiceMessageInfo.findByContext", query = "SELECT t FROM TServiceMessageInfo t WHERE t.context = :context"),
    @NamedQuery(name = "TServiceMessageInfo.findByExcuation", query = "SELECT t FROM TServiceMessageInfo t WHERE t.excuation = :excuation")})
public class TServiceMessageInfo implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Size(max = 255)
    @Column(name = "type")
    private String type;
    @Column(name = "time")
    private BigInteger time;
    @Size(max = 255)
    @Column(name = "context")
    private String context;
    @Column(name = "excuation")
    private Integer excuation;
    @JoinColumn(name = "g_info_id", referencedColumnName = "u_id")
    @ManyToOne(optional = false)
    private TUserGuardianInfo gInfoId;
    @JoinColumn(name = "ug_info_id", referencedColumnName = "u_id")
    @ManyToOne(optional = false)
    private TUserUnderGuardiansInfo ugInfoId;

    public TServiceMessageInfo() {
    }

    public TServiceMessageInfo(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BigInteger getTime() {
        return time;
    }

    public void setTime(BigInteger time) {
        this.time = time;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Integer getExcuation() {
        return excuation;
    }

    public void setExcuation(Integer excuation) {
        this.excuation = excuation;
    }

    public TUserGuardianInfo getGInfoId() {
        return gInfoId;
    }

    public void setGInfoId(TUserGuardianInfo gInfoId) {
        this.gInfoId = gInfoId;
    }

    public TUserUnderGuardiansInfo getUgInfoId() {
        return ugInfoId;
    }

    public void setUgInfoId(TUserUnderGuardiansInfo ugInfoId) {
        this.ugInfoId = ugInfoId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TServiceMessageInfo)) {
            return false;
        }
        TServiceMessageInfo other = (TServiceMessageInfo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pojo.TServiceMessageInfo[ id=" + id + " ]";
    }
    
}
